//
//  YBMeetingReleaseModel.m
//  GongXinDangJian
//
//  Created by apple on 17/12/11.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "YBMeetingReleaseModel.h"

@implementation YBMeetingReleaseModel

+ (NSDictionary *)modelContainerPropertyGenericClass {
    return @{@"NO_ENROLLS" : [YBMeetingNoEnrollModel class]};
}


-(NSString *)HY_UNREAD_USERS
{
    NSString * tempString = @"未报名:";
    NSArray * tempArray = self.NO_ENROLLS;
    if (self.NO_ENROLLS.count > 4) {
        tempArray = [self.NO_ENROLLS subarrayWithRange:NSMakeRange(0, 4)];
    }
    for (YBMeetingNoEnrollModel * model in tempArray) {
        tempString = [NSString stringWithFormat:@"%@%@-%@、" , tempString , model.PARTYMEMBER_DEPT_NAME , model.PARTYMEMBER_NAME];
    }
    if (tempString.length > 0) {
        tempString = [tempString substringToIndex:(tempString.length - 1)];
    }
    if (self.NO_ENROLLS.count > 4) {
        tempString = [NSString stringWithFormat:@"%@ 等" ,tempString];
    }
    return tempString;
}


-(CGFloat)unReadMsgHeight
{
    return [self.HY_UNREAD_USERS boundingRectWithSize:CGSizeMake([UIScreen zj_screenWith] - ItemWidth * 40, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : LYPFONT(13)} context:nil].size.height + 1;
}


-(NSString *)CREATE_TIME
{
    if (_CREATE_TIME.length > 16) {
        return [_CREATE_TIME substringToIndex:16];
    }
    else{
        return _CREATE_TIME;
    }
}

-(NSString *)END_TIME
{
    if (_END_TIME.length > 16) {
        return [_END_TIME substringToIndex:16];
    }
    else{
        return _END_TIME;
    }
}

-(NSString *)HY_START_TIME
{
    if (_HY_START_TIME.length > 16) {
        return [_HY_START_TIME substringToIndex:16];
    }
    else{
        return _HY_START_TIME;
    }
}

-(NSString *)START_TIME
{
    if (_START_TIME.length > 16) {
        return [_START_TIME substringToIndex:16];
    }
    else{
        return _START_TIME;
    }
}

-(NSString *)UPDATE_TIME
{
    if (_UPDATE_TIME.length > 16) {
        return [_UPDATE_TIME substringToIndex:16];
    }
    else{
        return _UPDATE_TIME;
    }
}


@end
